<!-- 激活兑换 -->
<template>
	<view>
		<u-navbar title="激活兑换" bgColor="transparent"  placeholder
			autoBack>
		</u-navbar>

		<view class="pd30">
			<u--input placeholder="请输入兑换码" border="surround" shape="circle" v-model="code"></u--input>

			<view class="mt80 btn">
				<u-button type="primary" shape="circle" text="点击兑换" @click="submit"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				code: ''
			};
		},
		methods: {
			submit() {
				if (!this.code) {
					this.$tools.toast('请输入兑换码');
					return
				}
				let params = {
					code_key: this.code
				}
				this.$api.activateCode(params).then(res => {
					this.$tools.toast(res.msg);
					if (res.code == 200) {
						setTimeout(() => {
							uni.navigateBack()
						}, 700)
					}
				})
			}
		}
	}
</script>

<style lang="less">
	// /deep/.u-border {
	// 	border-color: #fff !important;
	// }

	// /deep/.uni-input-placeholder,
	// /deep/.uni-textarea-placeholder {
	// 	color: #f5f5f5 !important;
	// }
	// /deep/.uni-input{
	// 	color: #fff !important;
	// }

	.btn {
		position: absolute;
		bottom: 10vh;
		width: 80vw;
		left: 10vw;
	}
</style>